import { param } from "change-case";

export const apData = [
    {
        id: '2000',
        name: '70:3a:0e:cb:6b:9c',
        status: 'Up',
        configuration: 'Good',
        controller: 'SLR01-WIFI-IT1a',
        AP_group: 'SLR01-OFFLINE',
        upstream_device: '',
        upstream_port: '',
        type: 'Aruba AP 225',
        remote: 'No',
        last_contacted: '3/13/2018 8:55 PM PDT',
        uptime: '153 days 0 hrs 3 mins',
        Lan_MAC: '00:1A:1E:02:F5:70',
        serial: 'CNBTHMV1Q0',
        IP: '10.5.62.33',
        clients: 7,
        usage: '0.00 Kbps',
        notes: '',
        radios: [
            { index: 1, name: '802.11bgn', mac: '70:3A:0E:36:B9:C0', clients: 5, usage: '0.00 Kbps', channel: '', tx_power: '', antenna_type: 'internal', ssid: '' },
            { index: 2, name: '802.11ac', mac: '70:3A:0E:36:B9:D0', clients: 2, usage: '0.00 Kbps', channel: '', tx_power: '', antenna_type: 'internal', ssid: '' }
        ],
        wired_interfaces: [
            { name: 'Enet0', mac: '70:3A:0E:CB:6B:9C', clients: 5, admin_status: 'Up', operational_status: 'Up', type: 'gigabitEthernet', duplex: 'Full', port_mode: 'N/A', input_capacity: '1000 Mbps', output_capacity: '1000 Mbps' },
            { name: 'Enet1', mac: '70:3A:0E:CB:6B:9D', clients: 2, admin_status: 'Up', operational_status: 'Down', type: 'gigabitEthernet', duplex: 'Half', port_mode: 'Active Standby', input_capacity: '10Mbps', output_capacity: '10Mbps' }
        ]
    }
];

export const radioColumns = [
    {
        'title': '序号',
        'key': 'index',
        sortable: true
    },
    {
        'title': '名称',
        'key': 'name',
        width: 100
    },
    {
        'title': 'mac地址',
        'key': 'mac',
        width: 144
    },
    {
        'title': '终端数',
        'key': 'clients',
        sortable: true
    },
    {
        'title': '用量',
        'key': 'usage'
    },
    {
        'title': '频道',
        'key': 'channel'
    },
    {
        'title': 'tx_power',
        'key': 'tx_power'
    },
    {
        'title': '天线类型',
        'key': 'antenna_type'
    },
    {
        'title': 'SSID',
        'key': 'ssid'
    }
];

export const wiredColumns = [
    {
        'title': '名称',
        'key': 'name',
        width: 100
    },
    {
        'title': 'mac地址',
        'key': 'mac',
        width: 144
    },
    {
        'title': '终端数',
        'key': 'clients',
        sortable: true
    },
    {
        'title': 'admin_status',
        'key': 'admin_status'
    },
    {
        'title': 'operational_status',
        'key': 'operational_status'
    },
    {
        'title': '类型',
        'key': 'type'
    },
    {
        'title': 'duplex',
        'key': 'duplex'
    },
    {
        'title': '端口模式',
        'key': 'port_mode'
    },
    {
        'title': '输入速度',
        'key': 'input_capacity'
    },
    {
        'title': '输出速度',
        'key': 'output_capacity'
    }
];

export const apColumns = [
    {
        'title': '名称',
        'key': 'name',
        'fixed': 'left',
        width: 140,
        render: (h, params) => {
            return h('a', {
                domProps: {
                    href: `#/AP-detail/${params.row.id}`
                }
            }, params.row.name);
        }
    },
    {
        'title': '状态',
        'key': 'show',
        'width': 80,
        filters: [
            {
                label: 'Up',
                value: 'Up'
            },
            {
                label: 'Down',
                value: 'Down'
            }
        ],
        filterMultiple: false,
        filterMethod(value, row) {
            return row.status === value

        },
        render: (h, params) => {
            return h('Tag', {
                props:
                    { color: params.row.status === 'Up' ? 'green' : 'red' }
            }, params.row.status);
        }
    },
    {
        'title': '配置',
        'key': 'configuration'
    },
    {
        'title': '控制器',
        'key': 'controller',
        render: (h, params) => {
            return h('a', {
                domProps:
                    { href: `/#/AC-detail/${params.row.controller}` }
            }, params.row.controller);
        }
    },
    {
        'title': '终端数',
        'key': 'clients',
        'sortable': true
    },
    {
        'title': 'IP',
        'key': 'IP'
    },
    {
        'title': '型号',
        'key': 'type'
    },
    {
        'title': '运行时间',
        'key': 'uptime',
        'sortable': true
    }
];
